package com.zeldu.student.mapper;

import com.zeldu.student.pojo.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface StudentInfoMapper {
    @Select("select * from student where id=#{id}")
    Student getSelfInfo(Long id);

    @Update("update student set phone=#{phone},real_name=#{realName},email_addr=#{emailAddr},head_url=#{headUrl},sex=#{sex} where id=#{id}")
    int mdfSelfInfo(Student student);

    @Update("update student set class_id=#{classId} where id=#{id} and class_id is null")
    int joinClass(Student student);

    @Select("select class_name from class where id=#{id}")
    String getClassName(Long id);
}
